#pragma once

#include "Ceworld.h"
#include "GridCtrl.h"
#include "afxwin.h"

typedef struct{
	EOBJTYPE type;
	int nAge;
	int nLife;
}E_OBJ_DETAIL;

// CDetialDlg dialog

class CDetailDlg : public CDialog
{
	DECLARE_DYNAMIC(CDetailDlg)

public:
	CDetailDlg( int nWorldWidth, int nWorldHeight, CeObject** map, CWnd* pParent = NULL);   // standard constructor
	virtual ~CDetailDlg();

// Dialog Data
	enum { IDD = IDD_DETAILDLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

	E_OBJ_DETAIL* pObjMap;
	int m_nWorldWidth;
	int m_nWorldHeight;

public:
	CGridCtrl m_GridCtrl;
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
protected:
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
public:
	int m_nCellAge;
	int m_nCellLife;
	CListBox m_listAgeResult;
	afx_msg void OnBnClickedAgesearch();
	int m_nAgeToFind;
	afx_msg void OnLbnDblclkAgeresultlist();
	afx_msg void OnLbnSelchangeAgeresultlist();
	int m_nLifeToFind;
	CListBox m_listLifeResult;
	afx_msg void OnBnClickedLifesearch();
	afx_msg void OnLbnSelchangeLiferesultlist();
};
